
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<script src="../js/vue.min.js"></script>
		<script src="../js/vant.min.js"></script>
		<script src="../js/ajax.js"></script>
		<link rel="stylesheet" href="../css/index.css" />
		<script src="html5plus://ready"></script>
		<script src="../js/listener_other.js"></script>
		<title>登录 </title>
	</head>
	<body placeholder="nihao">
		<div id="app">
			<van-row style="background-color:orangered; height:30px;line-height:46px;"></van-row>
			<van-row style="background-color: white;margin-top: 10%;">

				<van-col offset="8" span="8" style="text-align: center;">
				<img src="../img/234520190331185019.jpg"/>
				</van-col>
				<van-col span="8" style="text-align: center;"></van-col>
			</van-row>
			<van-row style="background-color: white;margin-top: 10%;">
				<van-col offset="3" span="18">

					<span>
					<van-icon name="phone" color="#323233" size="200%" ></van-icon>:
				</span>
					<span style="padding-bottom: 10px;">
					<input type="text" placeholder="手机号码" v-model="phone"  style="border: none;" />
				</span>

				</van-col>

			</van-row>
			<van-row style="background-color: white;margin-top: 10%;">
				<van-col offset="3" span="18">

					<span>
					<van-icon name="home-o" color="#323233" size="200%" ></van-icon>:
				</span>
					<span style="padding-bottom: 10px;">
					<input type="password" placeholder="登录密码" v-model="passwords" style="border: none;" />
				</span>

				</van-col>

			</van-row>
			<van-row style="background-color: white;margin-top: 10%;">
				<van-col offset="16" span="8">

					<a @click="URL('../personcenter/wangji.html')" style="text-decoration: none; color: #323233;">忘记密码？</a>
				</van-col>

			</van-row>
			<van-row style="background-color: white;margin-top: 10%;">
				<van-col offset="3" span="18">

					<van-button type="danger" @click="denglu" size="large">登录</van-button>
				</van-col>

				<van-col offset="6" span="12">

					<a href="zhuce.html" style="text-decoration: none; color: #323233;">还没有注册？立即注册</a>
				</van-col>

			</van-row>

		</div>

		</van-card>

		</div>
		<script type="text/javascript">
			var vm = new Vue({

				el: "#app",

				data: {
					passwords: "",
					phone: ""

				},

				methods: {
					URL:function(url){
						plus.webview.open(url);
						
					},
					denglu: function(res) {

						var a=parseInt(this.phone);
						ajax({
							url: "http://dsapi.ysd3g.com/api/login",
							dataType:"jsonp",
							data: {
								account:a,password:this.passwords
							},
							"success": function(res) {
								var myself=plus.webview.getWebviewById("myself");
								myself.reload(true);
								alert("尊敬的"+res.UserData.NickName+"用户，很高兴为你服务");
								localStorage.setItem("Phone", res.UserData.Phone);
								localStorage.setItem("key",res.Key);
								localStorage.setItem("Error",res.Error);
								localStorage.setItem("Name",res.UserData.NickName);
								localStorage.setItem("imgurl",res.UserData.AvatarImage);
								localStorage.setItem('userData', JSON.stringify(res.UserData));
								var denglu=plus.webview.currentWebview();
								plus.webview.close(denglu);
								
								
							}

						})
					},
					
				}

			});
		</script>
	</body>
</html>